package com.dragon.common.modules.uaa.web.models.params;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author Chris Chan
 * Create On 2025/8/8 下午12:23
 * Use for:
 * Explain:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "通过手机号重置密码参数")
public class ResetPasswordByMobileParam implements Serializable {
    private static final long serialVersionUID = 1L;
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    @Schema(description = "手机号")
    private String mobile;

    @NotBlank(message = "验证码不能为空")
    @Schema(description = "验证码")
    private String verifyCode;

    public static ResetPasswordByMobileParam of(String mobile, String verifyCode) {
        return new ResetPasswordByMobileParam(mobile, verifyCode);
    }

    public static ResetPasswordByMobileParam create(String mobile, String verifyCode) {
        return new ResetPasswordByMobileParam(mobile, verifyCode);
    }
}
